from datetime import datetime, timedelta

a = datetime(2012, 9, 23)
print(a)
print(a + timedelta(days=10))

b = datetime(2012, 12, 21)
d = b - a
print(d.days)

now = datetime.now()
print(now)
print(now + timedelta(minutes=10))

a = datetime(2012, 9, 23)


text = '2012-09-20 23:59:59'
date = datetime.strptime(text, '%Y-%m-%d %H:%M:%S')
print(date)